<html>
	<head>
		<title>Class Standings</title>
		<style>
		.schedule{
			border-style: solid;
			border-width: 1px;
			padding: 3px;
		}
		
		p, .pMirror{
			font-family: "Trebuchet MS", sans-serif;
			font-size: 13px;
			text-align: justify;
			color: #000000;
			margin-right: 8px;
		}
		
		input.noborder{
			border: none;
			border-color: #FFFFFF;
		}
		
		h1{
			font-family: Arial, Helvetica, sans-serif;
			font-size: 18px;
			color: #000000;
		}
		</style>
	</head>
	<body>
		<table class="schedule">
		<?php
			include("write_functions.php");
			include("mark.php");
			connect("localhost", "root", "", "gradegriddatabase");
			$classid = $_GET["classid"];
			//Query for the students
			$findstudents_query = sprintf("SELECT last_name, first_name, account_id FROM account WHERE account_id IN
										  (SELECT account_id FROM take WHERE class_id = '%s') ORDER BY last_name, first_name",
									      $classid);
			$fsq = mysql_query($findstudents_query);
			$student_limit = mysql_num_rows($fsq);
			
			$schemeid_query = mysql_query("SELECT las)
			
			$i = 0;
			
			while($i < $student_limit){
				mysql_data_seek($fsq, $i);
				$student = mysql_fetch_array($fsq);
				$totals_query = mysql_query("SELECT * FROM total WHERE account_id = '" . $student["account_id"] . "' AND class_id = '$classid'");
				$totals_array = mysql_fetch_array($totals_query);
				echo "<tr><td class='schedule'>" . $student["last_name"] . ", " . $student["first_name"] . "</td>";
				echo "<td class='schedule'>" . $totals_array["totalgrade"] . "</td></tr>\n";
				$i++;
			}
		?>
	</body>
</html>